{:W('Cate/header')}
{:W('Cate/left')}
<!--内容部分-->
<div class="content">
    <div class="title">
        <p>订单管理</p>
        <i class="icon-angle-right"></i>
        <p class="active">订单记录</p>
    </div>
    <div class="admin_list clearfix">
        <div class="main">
            <div class="main_title">
                <form action="{:U('order_record/order_record')}" method="get">
                    <ul class="clearfix">
                        <li>
                            <span>开始时间</span>
                            <if condition="$param['begintime'] eq true">
                                <input value="{$param.begintime|date='Y-m-d H:i:s',###}" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">
                                <else/>
                                <input value="" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">
                            </if>
                        </li>
                        <li>
                            <span>结束时间</span>
                            <if condition="$param['endtime'] eq true">
                                <input value="{$param.endtime|date='Y-m-d H:i:s',###}" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">
                                <else/>
                                <input value="" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">
                            </if>
                        </li>
                        <button type="submit"><img src="__PUBLIC__/images/seach.png">搜索</button>
                    </ul>
                </form>
            </div>
            <div class="main_list" style="padding-top:15px;">
                <div class="main_list_list user_list">
                    <dl>
                        <dt>
                            <span style="width:5%">序号</span>
                            <span style="width:20%">收费模式</span>
                            <span style="width:20%">服务数量</span>
                            <span style="width:20%">开通时间</span>
                            <span style="width:20%">到期时间</span>
                            <span style="width:15%">服务状态</span>
                        </dt>
                        <volist name="array['companys']" id='row' key="k">
                        <dd>
                            <span style="width:5%">{$k}</span>
                            <span style="width:20%">
                            <if condition="$row['paymode'] eq 0">
                                        免费测试
                                    <elseif condition="$row['paymode'] eq 1"/>
                                         通道授权
                                </if>
                            </span>
                            <span style="width:20%">{$row['servicecount']}</span>
                            <span style="width:20%">
                                {$row['servicestarttime']|date="Y-m-d H:i:s",###}
                            </span>
                            <span style="width:20%">
                                {$row['serviceendtime']|date="Y-m-d H:i:s",###}
                            </span>
                            <span style="width:15%" class="clolrS active">
                            <if condition="$row['servicestatus'] eq 0">
                                                                  进行中
                                <elseif condition="$row['servicestatus'] eq 1"/>
                                       <font style="color: #5b6175">已过期</font>
                                <elseif condition="$row['servicestatus'] eq 2"/>
                                        <font style="color: #5b6175">未开通</font>
                                </if>
                            </span>
                        </dd>
                        </volist>
                    </dl>
                </div>
            </div>
            <div class="fy" id="page"></div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#begintime', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss', //日期格式
            type:'datetime',
        });

        laydate.render({
            elem: '#endtime', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss', //日期格式
            type:'datetime',
        });
    });
    $(document).ready(function () {
        layui.use('laypage', function(){
            var laypage = layui.laypage;

            //执行一个laypage实例
            laypage.render({
                elem: 'page'
                ,count: "<?php echo $totnum; ?>"
                ,limit: "<?php echo $pagecount; ?>"
                ,layout: ['prev', 'page', 'next', 'limit', 'skip']
                ,curr:function(){
                    var page = location.search.match(/pageid=(\d+)/);
                    return page ? page[1] : 1;
                }()
                ,jump: function(obj,first){  //点击页码出发的事件
                    if(first!=true){  //是否首次进入页面
                        var user = "<?php echo $param['user']; ?>";
                        var begintime = "<?php echo $param['begintime']; ?>";
                        if(begintime){
                            begintime = "<?php echo date('Y-m-d H:i:s',$param['begintime']); ?>";
                        }
                        var endtime = "<?php echo $param['endtime']; ?>";
                        if(endtime){
                            endtime = "<?php echo date('Y-m-d H:i:s',$param['endtime']); ?>";
                        }
                        var _url = "/operation_log/operation_log?pageid="+obj.curr+"&pagecount="+obj.limit;
                        if(user || begintime || endtime){
                            _url = "/operation_log/operation_log?pageid="+obj.curr+"&pagecount="+obj.limit+"&user="+user+"&begintime="+begintime+'&endtime='+endtime;
                        }
                        window.location.href = _url;
                    }
                }
            });
        });
    });
</script>
</html>